package com.zmc.order.infrastructure.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmc.order.infrastructure.bean.query.OrderSettingQuery;
import org.springframework.stereotype.Service;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zmc.common.utils.PageUtils;
import com.zmc.order.infrastructure.dao.OrderSettingDao;
import com.zmc.order.infrastructure.entity.OrderSettingEntity;
import com.zmc.order.infrastructure.service.OrderSettingService;


/**
 * @author zmc
 */
@Service("orderSettingService")
public class OrderSettingServiceImpl extends ServiceImpl<OrderSettingDao, OrderSettingEntity> implements OrderSettingService {

    @Override
    public PageUtils queryPage(OrderSettingQuery query) {
        return new PageUtils(baseMapper.selectPage(new Page<>(query.getPageNum(), query.getPageSize()), getWrapper(query)));
    }

    @Override
    public List<OrderSettingEntity> selectList(OrderSettingQuery query) {
        return list(getWrapper(query));
    }

    public LambdaQueryWrapper<OrderSettingEntity> getWrapper(OrderSettingQuery query) {

        return new LambdaQueryWrapper<>();
    }

}